import { get,post,put,del } from '@/api/uni_request'
/*
 * 跟课程相关的API方法
 */
const model_course = '/app/v3/'

const model_currency = '/'

/**
 * 商品详情
 */
export const getMerchandiseDetail = function(params) {
	return get(model_course + `_merchandise_info/${params.id}/_detail`, params)
}

/**
 * 添加购物车
 */
export const postTrolleyAdd = function(params) {
	return post(model_course + '_shopping_trolley/_create', params)
}

/**
 * 商品规格列表
 */
export const getMerchandiseSpecList = function(params) {
	return get(model_course + '_merchandise_specification/_list', params)
}

/**
 * 商品规格详情
 */
export const getMerchandiseSpecDetail = function(params) {
	return get(model_course + `_merchandise_specification/${params.merchandiseId}/_info`, params)
}


/**
 * 购物车列表
 */
export const getTrolleyList = function(params) {
	return get(model_course + '_shopping_trolley/_list', params)
}

/**
 * 购物车详情
 */
export const getTrolleyDetail = function(params) {
	return get(model_course + `_shopping_trolley/${params.id}/_detail`, params)
}
/**
 * 批量删除购物车
 */
export const batchTrolleyDelete = function(params) {
	return post(model_course + '_shopping_trolley/_delete_batch', params)
}
/**
 * 查询购物车总件数
 */
export const queryTrolleyTotal = function(params) {
	return post(model_course + `_shopping_trolley/_total`, params)
}
/**
 * 修改购物车
 */
export const updateTrolley = function(params) {
	return post(model_course + `_shopping_trolley/${params.id}/_update`, params)
}
/**获取用户地址列表**/
export const userAddress = function(params) {
	return get(model_course + `_address_info/_list`, params)
}
/**新增用户地址**/
export const addAddress = function(params) {
	return post(model_course + `_address_info/_create`, params)
}
/**删除用户地址**/
export const delAddress = function(params) {
	return post(model_course + `_address_info/_delete_batch`, params)
}
/**修改地址**/
export const modifyAddress = function(params) {
	return post(model_course + `_address_info/${params.id}/_update`, params)
}

/**
 * 批量查询购物车
 */
export const batchQueryTrolley = function(params) {
	return post(model_course + `_shopping_trolley/_query_batch`, params)
}

/**
 * 商品下单
 */
export const postOrderCreate = function(params) {
	return post(model_course + '_order_info/_create', params)
}
/**
 * 订单列表
 */
export const getOrderList = function(params) {
	return get(model_course + `_order_info/_list`, params)
}
/**
 * 批量取消订单【待付款订单】
 */
export const batchCancelOrder = function(params) {
	return post(model_course + '_order_info/_update_batch_cancel', params)
}
/**
 * 批量取消订单【已付款订单】
 */
export const batchRefundOrder = function(params) {
	return post(model_course + '_order_info/_update_batch_refund', params)
}

/**
 * 确认收货
 */
export const postConfirmReceipt = function(params) {
	return post(model_course + `_order_info/${params.id}/_confirm_receipt`, params)
}

/**
 * 评价订单
 */
export const postEvaluateOrder = function(params) {
	return post(model_course + '_order_evaluate/_create', params)
}
/**
 * 订单详情
 */
export const getOrderDetail = function(params) {
	return get(model_course + `_order_info/${params.id}/_detail`, params)
}
/**
 * 获取微信支付参数
 */
export const getWxPayParams = function(params) {
	return get(model_course + `_order_info/${params.id}/_wx_pay`)
}
/**
 * 修改收货地址
 */
export const updateReceiverInfo = function(params) {
	return post(model_course + `_order_info/${params.id}/_update_receiver_info`, params)
}
/**
 * 获取查询物流信息
 */
export const queryExpressage = function(params) {
	return get(model_course + `queryExpressage`, params)
}
/**
 *  协议数据
 */
export const getAgreement = function(params) {
	return get(`/app/merchant/agreement`, params)
}
/**
 *  评价列表
 */
export const getEvaluate = function(params) {
	return get(model_course + `_order_evaluate/_list`, params)
}
/**
 *  新增订单评分
 */
export const addEvaluate = function(params) {
	return post(model_course + `_order_evaluate/_create`, params)
}
/**
 *  删除订单评分
 */
export const delEvaluate = function(params) {
	return post(model_course + `_order_evaluate/_delete_batch`, params)
}
/**
 *  订单评分详情
 */
export const evaluateDetail = function(params) {
	return get(model_course + `_order_evaluate/${params}/_detail`, params)
}
/**
 *  门店信息
 */
export const getShop = function(params) {
	return get(`/app/appointment/${params.shopId}/_shop_info`, params)
}
/**
 *  获取用户信息
 */
export const getUser = function(params) {
	return get(`/app/user/userInfo`, params)
}
// 分类详情
export const getClassDetail = function(params) {
	return get(`/app/appointment/_product_classification/${params}/_product_classification_info`, params)
}
// 商品列表
export const getGoodsList = function(params) {
	return get(model_course + `_merchandise_info/_list`, params)
}
// 商品分类
export const getGoodsClass = function(params) {
	return get(`/app/appointment/_product_classification/_product_classification_list`, params)
}